home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / disk / mt220.zip / MT.TXT < prev    next >
Text File  |  1997-04-01  |  10KB  |  220 lines

  1.               MT - Move To drive/directory
  2.  
  3.               Copyright Jason Hood 1996-7
  4.  
  5.                  Freeware. Version 2.20
  6.  
  7.  
  8.                   Description
  9.  
  10.  mt is a complete CD replacement.  It allows for the use of slash ("/") as well
  11.  as backslash ("\") in directory  names.  The dot notation has been extended so
  12.  "grandparent"  and  "great-grandparent",  etc.,  can  be  specified.   Partial
  13.  directory  names are supported.  Previous  directories are remembered.  And of
  14.  course, the drive can be changed along with the directory.
  15.  
  16.  
  17.                   Requirements
  18.  
  19.     DOS 3.0+
  20.     286+ (but could be recompiled for less)
  21.  
  22.  
  23.                   Installation
  24.  
  25.  Place mt.com in your path.  It doesn't really matter where the other files go.
  26.  Add this to your autoexec.bat:
  27.  
  28.     [path]mtmem.com [d:/path] [;prev[;prev;prev...]
  29.  
  30.  where: path is the path to mtmem.com;
  31.     d:/path is the drive and path to place the directory structure file;
  32.     ;prev... is the list of initial previous directories.
  33.  
  34.  If  d:/path  is not specified,  it will default to the same path as mtmem.com.
  35.  If the previous  directories  are not    specified  they will be set to nothing.
  36.  Memory will be allocated high (if available),    using best fit.  (The memory is
  37.  used to store the path and previous directories, as well as providing instance
  38.  data for task switchers.)
  39.  
  40.  The next step is to setup the directory structure file for the partial names:
  41.  
  42.     mt @drives
  43.  
  44.  where    drives    is the list  of drives    you wish  to scan.  The drives    will be
  45.  scanned  in the  order  specified  and invalid  drives will  be ignored.  I've
  46.  allowed for  1200 directories per drive.  If you have more than this,    it will
  47.  probably crash, 'coz I've not tested for it.
  48.  
  49.  
  50.                      Usage
  51.  
  52.  "mt ?"  or  "mt <any-character-of-your-choice>?"  will  display a  help screen
  53.  (at least, I hope it helps).
  54.  
  55.  "mt @cd",  for example,  will scan drives  C: and D:.  "mt @"  will update the
  56.  file for drives  previously scanned  (by totally rescanning the drives).   The
  57.  file's path can be changed via mtmem.com.
  58.  
  59.  "mt ..."  is equivalent to  "mt ..\.."  - ie.  it will move you to the "grand-
  60.  parent" directory.  Any number of dots can be specified, but of course it will
  61.  fail if you try to move too far back.    Note that the extra dots will only work
  62.  at the start of the path  -  if specified in the  middle you will get an error
  63.  (but it's a silly thing to do anyway).
  64.  
  65.  "mt;" will move you to the directory you just moved from  (so repeatedly doing
  66.  "mt;" will toggle between two directories). "mt;;" will move you to the direc-
  67.  tory before the previous directory. You can keep adding semicolons, or specify
  68.  a number after the first one - "mt;3" is equivalent to "mt;;;". If you use too
  69.  high a number, or the number 0, then nothing happens. The previous directories
  70.  can be explicitly set    by using mtmem.com.  Two previous directories are guar-
  71.  anteed; the path sizes determine the upper limit - usually about nine.
  72.  
  73.  "mt d:path" is the same as CD,  but it will change drive as well,  slashes (/)
  74.  can be used, and the trailing (back)slash (if any) will be removed. It is also
  75.  possible to use a star ("*") for the last directory name.  The first name that
  76.  matches (in the file table, not alphabetically)  will be selected.   So if you
  77.  have a games directory has dos and windows as subdirectories, and dos is first
  78.  in the file table,  then "mt d:/games/*"  will get you there.  Similarly,  "mt
  79.  d:/games/w*" will move you to the windows subdirectory.
  80.  
  81.  "mt name1 name2 ..."  (that's an ellipsis,  not grandparent) is roughly equiv-
  82.  alent to  "mt name1*/name2*/..."  - ie.  it looks for a  directory that starts
  83.  with name1, has a subdirectory that starts with name2, etc.  Note that if only
  84.  one name is specified it looks for a subdirectory before it starts the search.
  85.  
  86.  Searches always begin from the root,  in drive order  (when the structure file
  87.  was created).    To search a particular drive: "mt d:name1 name2 ..." where d is
  88.  the drive you want.   The first match found will be the one selected.    If it's
  89.  not the one you want,    you will need to narrow the search  (by specifying more
  90.  characters).    (I find it easier to type  than to select from    a damn annoying
  91.  pop-up window.)   Directories are stored alphabetically, with precedence given
  92.  to paths closer to the root.    So given directories /games and /windows/games,
  93.  "mt g"  will find /games,  since it closer to the root.   But with directories
  94.  /windows and /windoze,  "mt w" will find /windows, since "w" comes before "z".
  95.  If you are already in the  directory that matched first,  it will try and find
  96.  another match.  So with the two "w" directories above, "mt w" will move you to
  97.  "/windows" and "mt w" from within that directory  will move you to "/windoze".
  98.  
  99.  It's also  possible to specify  a complete path  after the partial paths,  for
  100.  those directories that have not yet been scanned.  "mt w /newdir"  will search
  101.  for a directory starting with "w"  (eg. "/windows")  and then add "/newdir" to
  102.  it, resulting in "/windows/newdir".
  103.  
  104.  "mt n,<partial path>"  (or "mt n*<partial path>") will select the nth match of
  105.  the partial path. If that is the current directory then the next match will be
  106.  selected. If n is zero then all matches will be listed.
  107.  
  108.  "mt +[+][path]"  will add path (and its subdirectories) to the structure file.
  109.  If it doesn't exist it will be created. The current directory will be added if
  110.  path is absent.  Unlike the MD command more than one directory can be created:
  111.  
  112.         mt +path1/path2        =    md path1
  113.                         md path1\path2
  114.  
  115.  If,  when creating directories,  a path already exists  (eg. "/games"  exists,
  116.  when doing "mt +/games/newgame"), then it is assumed that "/games" has already
  117.  been scanned,    so only the "newgame" part will be added.  The second plus will
  118.  also move you to the directory.
  119.  
  120.  If the drive  isn't in the  file then it  will be added with only the selected
  121.  directories. If the root is added (ie. "mt +c:/") then the whole drive will be
  122.  (re)scanned.
  123.  
  124.  "mt -path"  will remove path (and its subdirectories) from the file and delete
  125.  it from disk (EVERYTHING is deleted). "mt --path" will only remove it from the
  126.  file.    Removing a root directory (ie.    "mt -c:/") will remove the entire drive
  127.  from the file,  but it will  never be deleted    from disk.  path must  exist in
  128.  order for it  to be deleted  (ie.  RD'ing or DELTREE'ing  will mean rescanning
  129.  the entire drive,  or recreating the directories and removing again.)     If the
  130.  drive is not  in the file,  the path will still be deleted.   Note that unlike
  131.  DELTREE,  this will not delete individual files.  As a precaution, "mt -" will
  132.  not delete the current directory, use "mt -." instead.
  133.  
  134.  WARNING: THERE IS NO CONFIRMATION! It will be deleted IMMEDIATELY.
  135.  
  136.  One last option is  "mt #ext ...".  This replaces the normal "mtdirs.dat" file
  137.  with  "mtdirs.ext"  (for this line only).  It is intended for removable media,
  138.  particularly  shareware/magazine CD-ROMS.  So    "mt #pcw @e"  will scan E:  (my
  139.  CD) and create "mtdirs.pcw" (in the same path as "mtdirs.dat").  Then "mt #pcw
  140.  mods" will find a directory starting  with "mods" on that CD.  Two hashes will
  141.  make the extension permament  (place it  in the resident memory).  If "ext" is
  142.  omitted, it will default to "dat".
  143.  
  144.  Finally,  it is possible to do multiple options on one line.  However, as soon
  145.  as a move is encountered, processing will stop:
  146.  
  147.     mt +abc +def ++ghi        will create three directories and move
  148.                     to "ghi".
  149.  
  150.     mt ++ghi +abc +def        will create and move to "ghi", but skip
  151.                     the other two.
  152.  
  153.  
  154.                   Return Code
  155.  
  156.  0 - Successful operation (including help & status)
  157.  1 - MTMem not loaded
  158.  2 - Unable to create/load the structure file
  159.  3 - Directory not found
  160.  4 - Cannot create directory
  161.  5 - Cannot delete directory
  162.  
  163.  
  164.                    Known Limitations
  165.  
  166.  As mentioned above,  too many    directories on a  drive will  probably    cause a
  167.  crash    (but 1200 directories!).  This can be fixed by changing MaxDirs to 2000
  168.  and recompiling in the small model.
  169.  Removing all drives WILL result in a crash - just don't do it.
  170.  There is no "optimizing"  -  to remove paths that have been deleted from disk,
  171.  but still exist in the file, a complete rescan is necessary. Removing the last
  172.  directory of a drive will not result in that drive being removed.
  173.  There is no provision for renaming directories: either treat it as a good time
  174.  for a rescan, or use a batch file/doskey macro:
  175.  
  176.  rendir.bat:    @echo off    doskey rendir=mt --$1$Tmove $1 $2$Tmt +$2
  177.         mt --%1     (or you might like:
  178.         move %1 %2    doskey rendir=echo off$T<the above>$Techo on)
  179.         mt +%2
  180.  
  181.  
  182.                  Redistribution
  183.  
  184.  If you're just giving it to your mate,  only the two .com files are necessary.
  185.  However,  if you plan to upload it to a BBS or FTP site (or whatever), I'd ask
  186.  that you upload the original zip-file    (or whatever archiver  you prefer).  If
  187.  you modify the source, let me know and I'll redistribute an "official" version
  188.  (after all,  I still hold copyright),    but I have no objections if you distri-
  189.  bute both my original code and your modification (but please, do let me know).
  190.  
  191.  
  192.                     Address
  193.  
  194.  e-mail:    hoodj@topaz.cqu.edu.au
  195.  
  196.  snail mail:    Jason Hood
  197.         11 Buckle Street
  198.         North Rockhampton
  199.         Queensland, 4701
  200.         Australia.
  201.  
  202.  
  203.                     Finally
  204.  
  205.  This program is copyrighted Freeware.     Feel free to give it to all and sundry
  206.  (under the conditions mentioned in "Redistribution").   But if you sell it,  I
  207.  curse you to everlasting bankruptcy.
  208.  
  209.  
  210.                    Disclaimer
  211.  
  212.  Since I'm deleting directories, I'd better add this:
  213.  
  214.     I will not be held responsible for accidental deletion. I've warned
  215.     you that deletion will occur immediately and that all files will be
  216.     deleted.
  217.  
  218.  
  219.  Jason Hood, 1 April, 1997.
  220.